/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ircserver;

/**
 *
 * @author Justin
 */
import java.util.ArrayList;
import java.io.PrintWriter;
public class Users {
    ArrayList<PrintWriter> users;
    public Users()
    {
        users= new ArrayList();
    }
    public void writeInput(String input)
    {
        for(int i=0;i<users.size();i++)
        {
            System.out.println("got stuff"+input);
            PrintWriter out=new PrintWriter(users.get(i));
            out.println(input);
            out.flush();
        }
    }
    public void add(PrintWriter out)
    {
        users.add(out);
    }
    public void remove(PrintWriter out)
    {
        for(int i=0;i<=users.size();i++)
        {
            if(users.get(i).equals(out))
            {
                System.out.print(i);
                users.remove(i);

            }
        }
    }
}
